package cn.com.joycode.admin.entrance.controller.view;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Slf4j
@Controller
@RequestMapping("/public/view/auth")
public class LoginController {

    //private static RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();

    /**
     * 登录入口
     */
    @GetMapping("/login")
    public String login(HttpServletRequest request, HttpServletResponse response) throws Exception {
        // 跳转到登录页面
        //redirectStrategy.sendRedirect(request, response, NimbleAdminWebSecurityConfigurerAdapter.LOGIN_PAGE_URL);
        return "public/login";
    }

    /**
     * 登录页面入口
     */
    @RequestMapping("/view/login")
    public String loginView() {
        return "/webjars/pear-admin/login";
    }
}
